<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.fandy.struts.DAL.DALStaff"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.SQLException"%>
<%@page import="com.fandy.struts.Meta.Staff"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>


<%!public com.fandy.struts.Model.Staff SetStaff(
			com.fandy.struts.Model.Staff stf, ResultSet rs)
			throws SQLException {
		stf.setAddress(rs.getString(Staff.getAddress()));
		stf.setAuthority(rs.getString(Staff.getAuthority()));
		stf.setContact(rs.getString(Staff.getContact()));
		stf.setDepartmentid(rs.getInt(Staff.getDepartmentid()));
		stf.setName(rs.getString(Staff.getName()));
		stf.setPassword(rs.getString(Staff.getPassword()));
		stf.setSalary(rs.getInt(Staff.getSalary()));
		stf.setStaffid(rs.getInt(Staff.getStaffid()));

		return stf;
	}%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
	<html:base />

	<title>MyInfo.jsp</title>

	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	&nbsp;
	<jsp:include page="Header.jsp" />
	<div align="right">
		<a href="ManageGoods.jsp">返回商品管理</a>
	</div>
	<hr />
	<div id="tittle" align="center">
		我的信息
	</div>

	<div id="Search" align="center">
		<table cellpadding=0 cellspacing=0 style="margin-left: 15px">
			<tr valign=top>
				<td style="height: 62px; padding-left: 92px" nowrap>
					<form name=f action="Search.do" method="post">
						<input type=text name="keyword" size=42 maxlength=100>
						<input type=submit value=找找看 id=sb>
						<span id=hp> <br> </span>
					</form>
				</td>
			</tr>
		</table>
	</div>
	<div id="Goods" align="center">
<form action="UpdateStaffInfo.do"  "
						method="post">
		<table>
			<%
				DALStaff dstf = new DALStaff();
					ResultSet rs = null;

					com.fandy.struts.Model.Staff stf= new com.fandy.struts.Model.Staff();

					String Name = null;

					try {
						Name = request.getParameter("name");
					} catch (Exception e) {
					
						e.printStackTrace();
					}
					
					rs = dstf.getStaffInfoByName(Name);
					 
					if(rs.next()) {
						stf = SetStaff(stf, rs);
						
			%>
			<tr>
				<td align="center" width="180">
						<a><img height="188" width="155" alt="<%=stf.getName()%>"
								src="Image/<%=stf.getAuthority()%>.jpg"> </a>
						<br>
						<br>
						 
						<br>
						<br>
						<html:errors property="org.apache.struts.action.GLOBAL_MESSAGE" />
					 
				</td>
				<td align="left" width="200">
					
					
					<table height="125">
						<tr valign="top">
							<td rowspan="1">
								<a href="MyInfo.jsp?name=<%=stf.getName()%>" target="_Blank"><%=stf.getName()%>
								</a>
							</td>
						</tr>

						<tr>
							<td rowspan="1">
								姓名:
								<input type="text" name="<%=Staff.getName() %>"
									value="<%=stf.getName() %>" />
							</td>

						</tr>
						<tr>
							<td rowspan="1">
								所在部门:
								<input type="text" name="<%=Staff.getDepartmentid() %>"
									disabled="disabled" value="<%=stf.getDepartmentid() %>" />
							</td>
						</tr>
						<tr>
							<td rowspan="1">
								工号:
								<input type="text" name="<%=Staff.getStaffid() %>"
									disabled="disabled" value="<%=stf.getStaffid() %>" />
							</td>

						</tr>
						<tr>
							<td rowspan="1">
								薪水:
								<input type="text" name="<%=Staff.getSalary() %>"
									disabled="disabled" value="<%=stf.getSalary() %>" />
							</td>
						</tr>
						<tr>
							<td rowspan="1">
								地址:
								<input type="password" name="<%=Staff.getAddress() %>"
									value="<%=stf.getAddress() %>" />
							</td>

						</tr>


						<tr>
							<td rowspan="1">
								联系方式:
								<input type="text" name="<%=Staff.getContact() %>"
									value="<%=stf.getContact() %>" />
							</td>

						</tr>

						<tr>

							<td rowspan="1">
								<input type="submit" name="Edit" value="修改" />
							</td>


</div>
						</tr>

					</table>

				</td>

				<td align="center">

				</td>


			</tr>
			<tr>
				<td colspan="8">
					<hr />
				</td>

			</tr>
			<%
				}
			%>
		</table>
</form>
	</div>
	<jsp:include page="Footer.jsp" />

</body>
</html:html>




